#include "IFUException.h"
#include "Sifus.h"
#include "IFUConf.h"
#include "IFUMap.h"

extern "C" {
#include <stdlib.h>
}

using namespace std;

Sifus::Sifus() {
}

Sifus::~Sifus() {
  delete conf;
  //delete map;
}

void Sifus::initConf(int argc, char **argv) {
  // to supress warnings
  argc = 0;
  argv = 0;

  try {

    cout << "-> Init conf from: ifu.conf" << endl;
    conf = new IFUConf("ifu.conf");
    conf->setAvgSigma(1);

  } catch (IFUException e) {

    e.what();
    exit(1);

  }
}

void Sifus::initMap(int argc, char **argv) {
  // to supress warnings
  argc = 0;
  argv = 0;

  try {

    cout << "-> Init map from: ifu.map" << endl << endl;
    map = new IFUMap("ifu.map");

  } catch (IFUException e) {

    e.what();
    exit(0);

  }
}
